package com.bwie.system.controller;

import com.bwie.common.domain.Admin;
import com.bwie.common.result.Result;
import com.bwie.system.service.UserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author：作者姓名
 * @Package：com.bwie.system.controller
 * @Project：_yk
 * @name：UserController
 * @Date：2024/5/17 9:43
 */
@RestController
@RequestMapping("/User")
@Log4j2
public class UserController {

    @Autowired
    private UserService userService;



    @PostMapping("/toUser")
    public Result<Admin> login(@RequestParam String userName){
        log.info("接受到的参数是：{}",userName);
        Admin admin = userService.FindBy(userName);
        log.info("返回的参数是：{}",admin);
        return Result.success(admin);
    }
}
